﻿@using System.Threading.Tasks
@using Abp.Application.Services.Dto
@using Abp.Extensions
@using Abp.Timing;
@using Magicodes.WeChat.Web.Mvc.Models.WeChatApiSetting
@using Magicodes.Admin.Web.Areas.Admin.Startup
@using Magicodes.WeChat.Web.Mvc
@model SettingsViewModel
@{
    ViewBag.CurrentPageName = WeChatPageNames.Common.Roots_WeChatApiSetting;
}
@section Scripts
{
    <environment names="Development">
        <script src="@ContentRootUrl/view-resources/Views/WeChatApiSetting/Index.js" asp-append-version="true"></script>
    </environment>

    <environment names="Staging,Production">
        <script src="@ContentRootUrl/view-resources/Views/WeChatApiSetting/Index.min.js" asp-append-version="true"></script>
    </environment>
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("WeChatApiSetting")</span> <small>@L("SettingsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">
        <button id="SaveAllSettingsButton" class="btn btn-primary blue"><i class="fa fa-floppy-o"></i> @L("SaveAll")</button>
    </div>
</div>
<div class="portlet light margin-bottom-0">
    <div class="portlet-body">

        <div id="SettingsTabPanel" class="tabbable-line">
            <ul class="nav nav-tabs ">
                <li class="active">
                    <a href="#WeChatApiSettingTab" data-toggle="tab" aria-expanded="false">
                        @L("WeChatApiSetting")
                    </a>
                </li>
                <li>
                    <a href="#WeChatPayApiSettingTab" data-toggle="tab" aria-expanded="false">
                        @L("WeChatPayApiSetting")
                    </a>
                </li>
            </ul>

            <div class="tab-content">
                <div class="tab-pane active" id="WeChatApiSettingTab">
                    <form id="WeChatApiSettingForm">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="AppId" class="form-control edited" value="@Model.Settings.AppId">
                            <label>@L("AppId")</label>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="password" name="AppSecret" class="form-control edited" value="@Model.Settings.AppSecret">
                            <label>@L("AppSecret")</label>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="Token" class="form-control edited" value="@Model.Settings.Token">
                            <label>@L("Token")</label>
                        </div>
                        <div class="note note-warning">
                            <p>@L("TokenTip")</p>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="WeiXinAccount" class="form-control edited" value="@Model.Settings.WeiXinAccount">
                            <label>@L("WeiXinAccount")</label>
                        </div>
                    </form>
                </div>
                <div class="tab-pane" id="WeChatPayApiSettingTab">
                    <form id="WeChatPayApiSettingForm">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="MchId" class="form-control edited" value="@Model.PaySettings.MchId">
                            <label>@L("MchId")</label>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="password" name="CertPassword" class="form-control edited" value="@Model.PaySettings.CertPassword">
                            <label>@L("CertPassword")</label>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="PayCertPath" class="form-control edited" value="@Model.PaySettings.PayCertPath">
                            <label>@L("PayCertPath")</label>
                        </div>


                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="password" name="TenPayKey" class="form-control edited" value="@Model.PaySettings.TenPayKey">
                            <label>@L("TenPayKey")</label>
                        </div>
                        <div class="note note-warning">
                            <p>@L("NotifyTip")</p>
                        </div>
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <input type="text" name="Notify" class="form-control edited" value="@Model.PaySettings.Notify">
                            <label>@L("Notify")</label>
                        </div>
                    </form>
                </div>

            </div>

        </div>

    </div>
</div>
